# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataform.V1beta1.Model.WorkspaceCompilationOverrides do
  @moduledoc """
  Configures workspace compilation overrides for a repository. Primarily used by the UI (`console.cloud.google.com`). `schema_suffix` and `table_prefix` can have a special expression - `${workspaceName}`, which refers to the workspace name from which the compilation results will be created. API callers are expected to resolve the expression in these overrides and provide them explicitly in `code_compilation_config` (https://cloud.google.com/dataform/reference/rest/v1beta1/projects.locations.repositories.compilationResults#codecompilationconfig) when creating workspace-scoped compilation results.

  ## Attributes

  *   `defaultDatabase` (*type:* `String.t`, *default:* `nil`) - Optional. The default database (Google Cloud project ID).
  *   `schemaSuffix` (*type:* `String.t`, *default:* `nil`) - Optional. The suffix that should be appended to all schema (BigQuery dataset ID) names.
  *   `tablePrefix` (*type:* `String.t`, *default:* `nil`) - Optional. The prefix that should be prepended to all table names.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :defaultDatabase => String.t() | nil,
          :schemaSuffix => String.t() | nil,
          :tablePrefix => String.t() | nil
        }

  field(:defaultDatabase)
  field(:schemaSuffix)
  field(:tablePrefix)
end

defimpl Poison.Decoder, for: GoogleApi.Dataform.V1beta1.Model.WorkspaceCompilationOverrides do
  def decode(value, options) do
    GoogleApi.Dataform.V1beta1.Model.WorkspaceCompilationOverrides.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Dataform.V1beta1.Model.WorkspaceCompilationOverrides do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
